from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext import db
import base64

from header import *
from footer import *
from toidi import *
from highscore_entry import *

class MainHandler(webapp.RequestHandler):
  def get(self):
      name = base64.b64decode(self.request.get('name'))
      score = float(base64.b64decode(self.request.get('score')))
      
      he = Highscore_Entry()
      he.name = name
      he.score = score
      
      he.put()
      self.response.out.write('ok')


def main():
  application = webapp.WSGIApplication([('/app_highscore', MainHandler)],
                                       debug=True)
  util.run_wsgi_app(application)


if __name__ == '__main__':
  main()
